package com.sxz.sbs.module.mine.presenter;

import com.sxz.sbs.app.App;
import com.sxz.sbs.module.mine.mode.SystemFileMode;
import com.sxz.sbs.module.mine.view.PaymentCodeView;
import com.sxz.sbs.rx.RxPresenter;
import com.sxz.sbs.rx.RxSubscriber;
import com.sxz.sbs.rx.RxUtil;

import java.util.HashMap;

/**
 *  收款码获取P
 */

public class PaymentCodePresenter extends RxPresenter<PaymentCodeView>{
    /**
     * 收款码获取
     */
    public void getPayCode (HashMap<String,Object> map) {
        addSubscribe(App.getInstance().getApi().getSystemFile(map)
                .compose(RxUtil.<SystemFileMode>handleResult())
                .subscribeWith(new RxSubscriber<SystemFileMode>(mView){
                    @Override
                    public void onNext(SystemFileMode info) {
                        mView.onGetPaymentCodeSuccess(info);
                    }
                })
        );
    }

}
